-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow baking enums. #968
Allow baking enums. #968
Conversation
75d452f
to
1ac4f0e
Compare
Given the description I think
|
In a 2nd step we could think of allowing argument/option to dictate the enum values, similar to bake migrations etc: Backed int
Backed string
Default
In a 3rd step: If those would be part of the db field comment, it could be used to auto-generate the whole enum based on that, making it super RAD. |
Co-authored-by: ADmad <[email protected]>
Rename option `backed` to `backing-type` defaulting to `string`.
Looks like we can bake enums now for xmas:) |
Given that we only now have backed, and string vs int |
I would prefer if we keep the more descriptive name. |
Should it be just |
I can live with |
Never mind, t is theme :) That said: Shouldnt it throw an error if you define a short twice?
No error here.. |
Guess we are missing duplicate naming checks. |
…#971) * Make backing type a bool, since it defaults anyway on 1 of 2 options. * Use --int / -i as flag.
@ADmad it is now simpler, only one char for int So all good? |
or
Next step could be to use conventions to auto map/detect enums for table fields:
{EntityName}{FieldName}
enumE.g.
Users
table with fieldstatus
:User
entity andUserStatus
enum would map and get added to forms etc.the fails are unrelated and will be green once cakephp/cakephp#17482 is released with 5.0.4